package com.cykj.controller;

import com.cykj.service.ScenicService;
import com.cykj.util.ResponseDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/scenic")
public class ScenicController {
    @Autowired
    private ScenicService scenicService;
    @RequestMapping("/delete")
    public ResponseDto delete(int id){
        return scenicService.delete(id);
    }
    @RequestMapping("/alter")
    public ResponseDto alter(int scenicId, String scenicName, String scenicPrice, String scenicAddress, String scenicInfo){
        return scenicService.alter(scenicId, scenicName, scenicPrice, scenicAddress, scenicInfo);
    }
    @RequestMapping("/countTicketForScenic")
    ResponseDto countTicketForScenic(){
        return scenicService.countTicketForScenic();
    }
    @RequestMapping("/addScenic")
    public ResponseDto addScenic(String name, String price, String address, String info) {
        return scenicService.addScenic(name, price, address, info);
    }
    @RequestMapping("/searchInfo")
    public ResponseDto searchInfo(int pageCurr, int pageSize, String value) {
        return scenicService.searchInfo(pageCurr, pageSize, value);
    }
}
